home *** CD-ROM | disk | FTP | other *** search
- /*============================================================================*\
- * Concordia.c - Entry point to the Concordia MDEF
- *
- * Corcordia.c contains the entry point to the concordia MDEF at the function
- * called main. This file also contains two routines, GetTextState and
- * SetTextState, that didn't really seem to fit categorically in any other source
- * file (they should really have been in ROM, like Get- and SetPenState!).
- \*============================================================================*/
-
-
- /******************************************************************************\
- * Header Files
- \******************************************************************************/
-
- #include <Menus.h>
- #include <Quickdraw.h>
- #include <Types.h>
- #include "ChooseTkl.h"
- #include "Concordia.h"
- #include "DrawTkl.h"
- #include "PopUpTkl.h"
- #include "SizeTkl.h"
-
-
- /******************************************************************************\
- * Function Prototypes
- \******************************************************************************/
-
- pascal void main (short, MenuHandle, Rect *, Point, short *);
-
-
- #pragma segment Main
- /******************************************************************************\
- * main - Entry point for the Concordia MDEF
- \******************************************************************************/
-
- pascal void
- main (Message, TheMenu, MenuRect, HitPt, WhichItem)
- short Message; //Operation to be performed >>
- MenuHandle TheMenu; //=> Affected menu <>
- Rect *MenuRect; //-> Menu's rectangle <>
- Point HitPt; //Position of mouse >>
- short *WhichItem; //Selected item number <>
- {
- if (Message == mDrawMsg)
- DoDrawMsg (TheMenu, MenuRect);
- else if (Message == mChooseMsg)
- *WhichItem = DoChooseMsg (TheMenu, MenuRect, HitPt, *WhichItem);
- else if (Message == mSizeMsg)
- DoSizeMsg (TheMenu);
- else if (Message == mPopUpMsg)
- *WhichItem = DoPopUpMsg (TheMenu, MenuRect, HitPt.h, HitPt.v,
- *WhichItem);
- }
-
-
- #pragma segment Main
- /******************************************************************************\
- * GetTextState - Get the current state of text
- *
- * GetTextState gets the typeface, typestyle, typesize, and drawing mode of the
- * current font of the current GrafPort and places this information in the
- * TextStateRec specified by TextInfo.
- \******************************************************************************/
-
- void
- GetTextState (TextInfo)
- TextStateRec *TextInfo; //-> Text state info <<
- {
- GrafPtr CurrPort; //-> Current graphics port
-
- GetPort (&CurrPort);
- TextInfo->txFace = CurrPort->txFont;
- TextInfo->txStyle = CurrPort->txFace;
- TextInfo->txMode = CurrPort->txMode;
- TextInfo->txSize = CurrPort->txSize;
- }
-
-
- #pragma segment Main
- /******************************************************************************\
- * SetTextState - Set the current state of text
- *
- * SetTextState gets the typeface, typestyle, typesize, and drawing mode of the
- * current font of the current GrafPort and places this information in the
- * TextStateRec specified by TextInfo.
- \******************************************************************************/
-
- void
- SetTextState (TextInfo)
- TextStateRec *TextInfo; //-> Text state info >>
- {
- TextFont (TextInfo->txFace);
- TextFace (TextInfo->txStyle);
- TextMode (TextInfo->txMode);
- TextSize (TextInfo->txSize);
- }
-